Exercise 2
Johannes Breuer & Stefan Jünger
Introduction to Survey Data Cleaning Using Tidyverse in R
1
Load the GESIS Panel data as CSV.
Clues
The file format is CSV, accordingly you need the
readr
library and a function that starts with
read_...
2
Convert the variable
sex
to a factor.
Clues
You can do that while importing the data with the
col_types
argument or after loading them.
3
Export the dataset as Stata file.
Clues
You need the
haven::write_dta()
function.
Bonus
Export the dataset in the statistical software format of your choice and, if you have access to this software on your computer, open it for checking.
Clues
Again, you need one of th
haven::write_...()
functions.